<%--
  Created by IntelliJ IDEA.
  User: asus
  Date: 2015/3/27
  Time: 15:29
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <title></title>
    <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.4/css/bootstrap.min.css">
    <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
    <script src="http://cdn.bootcss.com/jquery/1.11.2/jquery.min.js"></script>

    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="http://cdn.bootcss.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>

    <script type="text/javascript" src="http://cdn.hcharts.cn/highcharts/highcharts.js"></script>
    <script type="text/javascript" src="http://cdn.hcharts.cn/highcharts/exporting.js"></script>
    <script type="text/javascript" src="http://cdn.hcharts.cn/highcharts/highcharts-3d.js"></script>

    <script type="text/javascript">
        $(document).ready(function() {
            var options = {
                chart: {
                    renderTo: 'container', //DIV容器ID
                    type: 'pie',
                    options3d: {
                        enabled: true,
                        alpha: 45,
                        beta: 0
                    }
                },
                title: {
                    text: '评价统计'
                },
                tooltip: {
                    pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
                },
                plotOptions: {
                    pie: {
                        allowPointSelect: true,
                        cursor: 'pointer',
                        depth: 35,
                        dataLabels: {
                            enabled: true,
                            format: '{point.name}'
                        }
                    }
                },
                series: [{
                    type: 'pie',
                    name: 'static'

                }]
            };
            //json url 地址这里我使用的servlet
            var url =  "http://localhost:8888/MicroMart/goods/monthSta";
            var text;
            $.post(url,function(txt) {
                options.series[0].data=eval('(' + txt + ')');
                var chart = new Highcharts.Chart(options);
            });

//              alert(text)
////             var chart = new Highcharts.Chart(options);
            })
    </script>
</head>
<body>

<c:if test="<%=request.getParameter("status")==""%>">
        <div id="container"  style="min-width:700px;height:400px"></div>
</c:if>
<ul class="media-list">
    <c:forEach items="${commentList.datas}" var="comments">
    <li class="media">
        <div class="media-left">
            <a href="#">
                <img class="media-object" width="64" height="64" src="<%=request.getContextPath()%>/resources/images/chatImages/2015.jpg" alt="...">
            </a>
        </div>
        <div class="media-body">
            <p class="text-right"><span style="float:left"><strong>${comments.user.username}</strong></span><span class="glyphicon glyphicon-dashboard"  aria-hidden="true">${comments.commentTime}</span></p>
            &nbsp; &nbsp; &nbsp; ${comments.content}
        </div>
    </li>
    </c:forEach>
</ul>
<jsp:include page="/jsp/public/commentPager.jsp">
    <jsp:param value="${commentList.total }" name="totalRecord"/>
    <jsp:param value="comment" name="url"/>
    <jsp:param value="${status}" name="status"/>
</jsp:include>
</body>
</html>
<%--<script>--%>
    <%--$(function () {--%>
        <%--$('#container').highcharts({--%>
            <%--chart: {--%>
                <%--type: 'pie',--%>
                <%--options3d: {--%>
                    <%--enabled: true,--%>
                    <%--alpha: 45,--%>
                    <%--beta: 0--%>
                <%--}--%>
            <%--},--%>
            <%--title: {--%>
                <%--text: 'Browser market shares at a specific website, 2014'--%>
            <%--},--%>
            <%--tooltip: {--%>
                <%--pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'--%>
            <%--},--%>
            <%--plotOptions: {--%>
                <%--pie: {--%>
                    <%--allowPointSelect: true,--%>
                    <%--cursor: 'pointer',--%>
                    <%--depth: 35,--%>
                    <%--dataLabels: {--%>
                        <%--enabled: true,--%>
                        <%--format: '{point.name}'--%>
                    <%--}--%>
                <%--}--%>
            <%--},--%>
            <%--series: [{--%>
                <%--type: 'pie',--%>
                <%--name: 'static',--%>
                <%--data: [--%>

                <%--]--%>
            <%--}]--%>
        <%--});--%>
    <%--});--%>
<%--</script>--%>